export default {
  changeImg(state, payload) {
    state.loginStatus = payload.loginStatus;
  },
  changeInfo(state, payload) {
    state.id = payload.id ? payload.id : '';
    state.userName = payload.userName ? payload.userName : '';
    state.phone = payload.phone ? payload.phone : '';
    state.userImg = payload.userImg ? 'http://' + payload.userImg : '';
  },
  changeInCenterPath(state, payload) {
    const { pathName } = payload;
    switch (pathName) {
      case 'info':
        state.inCenterPath = '个人信息';
        break;
      case 'release':
        state.inCenterPath = '发布课程';
        break;
      case 'management':
        state.inCenterPath = '管理课程';
        break;
      case 'income':
        state.inCenterPath = '我的收入';
        break;
      case 'questions':
        state.inCenterPath = '留言问答';
        break;
      case 'message':
        state.inCenterPath = '我的消息';
        break;
      default:
        break;
    }
  }
};
